package com.twu.biblioteca;

/**
 * Created with IntelliJ IDEA.
 * User: dbelsey
 * Date: 30/01/13
 * Time: 21:01
 */
public class Movie extends LibraryItem{
    private String year;
    private String director;
    // TODO: can only take certain values, consider an enum
    private int rating;

    public Movie(String title, String year, String director, int rating){
            this.title = title;
            this.year = year;
            this.director = director;
        // TODO: validation on rating value: must be positive, from 0-10
            this.rating = rating;
    }

    public String getYear(){
        return year;
    }

    public String getDirector(){
        return director;
    }

    public String getRating(){
        if(rating == 0) return "N/A";
        else  {
            String ratingAsString = "";
            for(int i = 0; i < rating; i++){
                ratingAsString = ratingAsString + "*";
            }
            return ratingAsString;
        }
    }

}
